import { defineStore } from "pinia";
interface user {
token: string,
role:string
}
const useIndexStore = defineStore("index", {
  state: () => {
    return {
      navCollapse: true,
      token:'',
      role:''
    };
  },
  actions: {
    toggleNavState() {
      this.navCollapse = !this.navCollapse 
    },
    initUser({token,role}:user) {
      this.token = token
      this.role = role
    }

   },
  // persist: true
});

export default useIndexStore;
